<?php

declare(strict_types=1);

namespace So\App\Request\Backend;

use So\Validation;

class IndexRequest extends Validation
{
    public $scene = [
        'login' => ['username', 'password'],
    ];

    public function rules(): array
    {
        return [
            'username' => 'required|min:3|max:30',
            'password' => 'required|min:3|max:30',
        ];
    }

    public function messages(): array
    {
        return [
            'username.required' => '请填写用户账号',
            'password.required' => '请填写用户密码',
            'username.min' => '账号不能小于三位',
            'password.min' => '密码不能小于三位',
            'username.max' => '账号不能小于三十位',
            'password.max' => '密码不能小于三十位',
        ];
    }
}